<?php

namespace App\Model;

use Hyperf\Database\Model\Builder;

/**
 * App\ChargeBalanceGive
 *
 * @property int $id
 * @property int $charge_fee 充值金额
 * @property int $give_fee 送的金额
 * @property int|null $sort 送的金额
 * @property int $is_active 状态 可见
 * @property \Carbon\Carbon|null $created_at
 * @property \Carbon\Carbon|null $updated_at
 * @method static Builder|\App\Model\ChargeBalanceGive isActive()
 * @method static Builder|\App\Model\ChargeBalanceGive newModelQuery()
 */
class ChargeBalanceGive extends Model
{
    public bool $timestamps = true;
    protected ?string $table = 'charge_balance_gives';
    //

    public function coupon()
    {
        return $this->belongsTo(Coupon::class,'id','coupon_id');
    }

    public function devices()
    {
        return $this->belongsToMany(Device::class, 'give_devices');
    }

    public function distributor()
    {
        return $this->belongsTo(Distributors::class,'id','distributor_id');
    }

}
